package com.easysan.design.pattern.creational.simplefactory;

/**
 * @author 13545
 * @Description: 简单工厂
 * @date 2021/6/6 13:31
 */
public class VideoFactory {

    public Video getVideo(Class classe) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        Video video = (Video) Class.forName(classe.getName()).newInstance();
        return video;
    }

    /*public Video getVideo(String type){
        if("java".equalsIgnoreCase(type)){
            return new JavaVideo();
        }else if("python".equalsIgnoreCase(type)){
            return new PythonVideo();
        }else{
            return null;
        }
    }*/
}
